package com.credithc.customers.api.utils;

import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @author zhukai
 * @date 2018/12/10 13:42
 */
@Component
public class RequestUtils {

    public static String generateRequest(HttpServletRequest request) throws IOException {
        BufferedReader br = null;
        try {
            br = new BufferedReader(new InputStreamReader(request.getInputStream(), "utf-8"));
            String line;
            StringBuilder sb = new StringBuilder();
            while ((line = br.readLine()) != null) {
                sb.append(line);
            }
            return sb.toString();
        }finally {
            if(br!=null){
                br.close();
            }
        }
    }


    public void checkRequestBaseParam(String dataStr){
    }
}
